#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : session_schema.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/3 17:16
from typing import List, Optional

from pydantic import Field, BaseModel
from datetime import datetime

from apps.utils.enumerate import SessionTypeEnum


class BaseSessionSchema(BaseModel):
    session_name: str = Field(description='会话名称', title='session_name')
    description: str = Field(description='描述', title='description')
    user_id: int = Field(description='用户id', title='user_id')
    session_type: SessionTypeEnum = Field(description='会话类型', title='session_type')
    model_id: int = Field(description='模型id', title='model_id')
    prompt: str = Field(description='提示词', title='prompt')
    network: bool = Field(description='是否支持网络', title='network')


class CreateSessionSchema(BaseModel):
    __doc__ = "创建文生图模型模式"


class UpdateSessionSchema(BaseModel):
    __doc__ = "更新文生图模型模式"


class SessionListSchemaBase(BaseModel):
    id: Optional[int]
    session_name: Optional[str]
    description: Optional[str]
    model_id: Optional[int]


class SessionListSchema(BaseModel):
    code: int
    message: str
    count: Optional[int]
    data: Optional[List[SessionListSchemaBase]]
